#include <game/ScreenBackend.h>
#include <game/ScreenBackendSite.h>
#include <game/ServiceProvider.h>
#include <game/services/DelayedActions.h>
#include <system/assert.h>
#include <boost/bind.hpp>

using namespace game;

ScreenBackend::ScreenBackend()
:	site(0)
{
}

ScreenBackend::~ScreenBackend()
{
}

void ScreenBackend::SetSite(ScreenBackendSite* site)
{
	this->site = site;
	this->site->GameServices().Query<services::DelayedActions>()->Schedule(
		boost::bind(&ScreenBackend::OnInitialized, this));
}

ScreenBackendSite* ScreenBackend::GetSite()
{
	LIBA_ASSERT(site);

	return site;
}